package com.gxa.adput.controller;

import com.gxa.adput.service.ReportManagementService;
import com.gxa.common.R;
import com.gxa.common.entity.platform_maintenance_service1001.ReportManagement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RestController
@RequestMapping("/reportManagement")
public class ReportManagementController {

    @Autowired
    private ReportManagementService reportManagementService;

    /**
     * 1.按照分页查询
     * @param currentPage
     * @param pageSize
     * @return
     */
    @GetMapping("/ReportManagementByPage")
    public R ReportManagementByPage(Integer currentPage, Integer pageSize){
        return reportManagementService.ReportManagementByPage(currentPage,pageSize);
    }

    /**
     * 2.按照条件查询
     */
    @PostMapping("/ReportManagementCondition")
    public R ReportManagementCondition(@RequestBody ReportManagement reportManagement){
        return reportManagementService.ReportManagementCondition(reportManagement);
    }

    /**
     * 3.根据状态来修改信息
     * @param reportManagement
     * @return
     */
    @PostMapping("/updateReportManagementByStatus")
    public  R updateReportManagementByStatus(@RequestBody ReportManagement reportManagement){
        return reportManagementService.updateReportManagementByStatus(reportManagement);
    }


    /**
     * 4.查询全部
     * @return
     */
    @GetMapping("/selectReportAll")
    public R selectReportAll(){
        return reportManagementService.selectReportAll();
    }
}
